import request from '@/utils/request';
/**
 * 客户中心相关接口
 * @param data
 *
 * @returns
 */
// 客户群基础信息
export const getGroupDetail = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/group/detail',
        method: 'GET',
        params: data
    });
};

// 群成员列表接口
export const getGroupMembers = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/group/members',
        method: 'POST',
        data
    });
};

export const downloadCustTemplate = (data?: any) => {
    return request({
        url: '/scrm-api/console/customer/download/cust/template',
        method: 'GET',
        params: data
    });
};

// sync_type  获取企微同步时间
export const getSyncTime = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/weiwork/sync-time',
        method: 'GET',
        params: data
    });
};

// 同步企微
export const custSync = (data?: any) => {
    return request({
        url: '/scrm-api/console/customer/sync',
        method: 'GET',
        params: data
    });
};

//同步抖音
export const tiktokSync = () => {
    return request({
        url: 'scrm-api/douyin/async-douyin-cust',
        method: 'POST'
    });
};
// 同步企业微信数据获取结果
export const custSyncResult = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/sync/get/result',
        method: 'GET',
        params: data,
        noNeedLoading: true
    });
};
// 获取客户阶段列表
export const getCustormerList = (data?: any) => {
    return request({
        url: 'scrm-api/console/customer/stage/list',
        method: 'post',
        data
    });
};

//抖音关注列表
export const fllowTiktok = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/douyin/follow/list',
        method: 'post',
        data
    });
};

/**
 * 企微群详情数据概览
 * @params data { type: 1 | 2, groupchat_id: number }
 * type: 1: 默认字段，2:全部字段,
 * groupchat_id: 群id
 */
export const getCustomerGroupDetailStat = (data: { type: 1 | 2; groupchat_id: number }) => {
    return request({
        url: '/scrm-api/console/customer/group/stat',
        method: 'POST',
        data
    });
};
